import org.omg.CORBA.LongLongSeqHelper;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class TestMain {
    public static Boolean suShu(long n) {
        if(n <= 2) {
            return true;
        }
        for(long i = n/2;i >= 2;i--) {
            if(n%i == 0) {
                return false;
            }
        }
        return true;
    }
    public static long a (long n) {
        long count = 0;
        for(long i = n/2; i >= 2;i--) {
            if(n % i == 0 && suShu(i)) {
                count =  i;
                break;
            }
        }
        return count;
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        // code here
        long n = input.nextLong();
        Map<Long,Long> map = new TreeMap<>();
        for(long i = 1; i <= n;i++) {
            map.put(n+1-i,i);
        }
        for(long i = 1; i <= n;i++) {
            if(!suShu(i)) {
                map.remove(i,n+1-i);
                long tmp = a(i);
                long c = map.get(tmp);
                map.put(tmp,c*i/tmp);
            }
        }
        System.out.print("f("+n+")"+"=");
        long x = map.size() - 1;
        for(Map.Entry<Long,Long> entry:map.entrySet()) {
            if(entry.getKey() != 1) {
                if(entry.getValue() == 1) {
                    System.out.print(entry.getKey());
                } else {
                    System.out.print(entry.getKey()+"^"+entry.getValue());
                }
                if(x > 1) {
                    x--;
                    System.out.print("*");
                }
            }

        }

        input.close();
    }
    public static void main2(String[] args) {
        Scanner input = new Scanner(System.in);
        // code here
        int m = input.nextInt();
        int n = input.nextInt();
        int k = input.nextInt();
        int[][] arr = new int[m][n];

        input.close();
    }
    public static void main3(String[] args) {
        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int a = 0;
        int b = 0;
        String arr = "shsshsshs*";
        int count = 0;
        for(int i = 0;i < n;i++) {
            if(arr.charAt(i) == 's') {
                for(int j = i;j < n; j++) {
                    if(arr.charAt(j)  == 'h') {
                        a = j - i;
                        for(int c = j;c < n;c++) {
                            if(arr.charAt(c) == 's') {
                                count = count;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(count);
        input.close();
    }
}
